class SandstoneRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;

	SandstoneRenderer(ITexture *texture) :
		Texture(texture)
	{
	}

	int GetTypeData(const int &data) { return data; }

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		auto &above = schematic->GetBlock(position.X, position.Y + 1, position.Z);
		Box box(Texture);

		Point2i side, bottom(Point2i(0, 11 * 16));
		box.SetTop(bottom);

		switch (block.Data)
		{
		case 0:
			side = Point2i(0, ((above != Block::Empty && ((above.ID == 24 && above.Data == 0) || (above.ID == 43 && (above.Data & ~0x8) == 1))) ? 13 : 12) * 16);
			bottom = Point2i(0, 13 * 16);
			break;
		case 1:
			side = Point2i(5 * 16, 14 * 16);
			break;
		case 2:
			side = Point2i(6 * 16, 14 * 16);
			break;
		}

		box.SetBottom(bottom).SetSides(side);
		renderer->Draw(box);
	}
};